import { IDict } from './dict.enum'

export const translate = (mapping: IDict[], val: number | string) => {
  const dict = mapping.find((dict) => dict.value === val)
  return dict ? dict.label : val
}
